<?php
	require_once APPPATH.'third_party/main_controller'.EXT;
	class Home extends Main_Controller
	{
		function __construct()
		{
			parent::__construct();
		}
		function index()
		{
			$data = array();
			$this->load_render($this->load->view('home',$data,TRUE));
		}
		function show_product_news()
		{
			             
            $data = array();            	
            $uid = $this->uri->segment('2');
            $id = $this->news_model->get_url_cat2($uid);            
			$data['title_cats'] = $this->news_model->get_name_cat($id);			
			$data['show_list_product'] = $this->news_model->show_list_product($id);			
			$this->load_render($this->load->view('demo1/list_news_product',$data,TRUE));
		}
		function detail()
		{
			$data = array();
			$uid = $this->uri->segment('2');	
            $key_id = explode('-',$uid);
            $count = count($key_id);
            $id = $key_id[$count-1];
			$data['title_cats'] = $this->news_model->get_name_cat($id);			
			$data['list_show'] = $this->news_model->get_news_product($id);			
			$this->load_render($this->load->view('demo1/detail',$data,TRUE));
		}
		
		
	}
?>